pp108 : create Method

create Method


This method creates and adds a new tuple to the data available in the busdataisland.

Syntax


oNode = object.create(sTagName [,sSourceID]);

Parameters

Parameter

Description

sTagName

Required. String that is taken as the name of the business element tag that is created.

sSourceID

Optional. String that specifies the ID of the element that had called this function.


Return Value

oNode

The business element node that has been added to the data in the busdataisland.


Remarks


This method internally calls the add method which actually creates and adds a new tuple to the data in the busdataisland.

Example
<script type="cordys/xml" id="requestProducts">
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP:Body>
            <GetProduct xmlns="http://schemas.cordys.com/1.0/demo/northwind">
                <ProductID>1</ProductID>
            </GetProduct>
        </SOAP:Body>
    </SOAP:Envelope>
</script>
<div cordysType="wcp.libaray.data.BusDataIsland id= ="bdiProducts" request="requestProducts.XMLDocument" async="false" ></div>
//Function which creates a new Product in the client.
function newTuple()
{
    //Set a new namespace for sending request
    bdiProducts.updateNamespace= "http://schemas.cordys.com/1.0/demo/northwind/Products";
    bdiProducts.create('Products');
}
//Function that updates the database with the new tuple created above.
function saveTuple()
{
    bdiProducts.synchronize();
}

See Also


busdataisland